<?php
namespace model\service;

use model\User;

final class UserService {
	
	/**
	 *	Currently logged in user.
	 * @var \model\User null if not logged in
	 */
	private $currentUser;
	
	private $initialized = false;

	function getUser() {
		return $this->currentUser;
	}

	function authenticate($login, $password) {
		$user = new User();
		// ...
		$this->currentUser = $user;
	}

	function isLoggedIn() {
		return $this->currentUser !== null;
	}

	function logout() {
		$this->currentUser = null;
	}
	
	function register(User $user) {
		
	}
}